<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<title>Home</title>
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />

<link href="resources/css/home.css" rel="stylesheet" type="text/css" />
<link href="resources/css/iphonebutton.css" rel="stylesheet" type="text/css" />
<link href="http://tjs.sjs.sinajs.cn/t3/style/css/common/card.css"
	type="text/css" rel="stylesheet" />
<script type="text/javascript" src="resources/js/jquery-1.6.2.js"></script>
<script type="text/javascript" src="resources/js/sina/wb.js"></script>
<script type="text/javascript" src="resources/js/common.js"></script>
<script type="text/javascript"
	src="resources/js/iphone-style-checkboxes.js"></script>

<script type="text/javascript">
	var onchange_checkbox;
	$(window).load(function() {
		onchange_checkbox = $('#css_sized_container').iphoneStyle({
			resizeContainer : false,
			resizeHandle : false
		});
	});

	function freshBalance() {
		$.get("trademanage/getBalance.do", function(data) {
			$("#nowBalance").html(data);
		});
	}

	function beforeChangeCheckbox() {
		var tradeId = $("#tradeId").val();
		var type = !onchange_checkbox.attr('checked');
		var result = false;
		$.ajax({
			type : "post",
			dataType : "text",
			async : false,
			url : "trademanage/setTradeStatus.do?tradeId=" + tradeId + "&type="
					+ !type,
			success : function(msg) {
				if ("ok" != msg) {
					alert("操作失败");
				} else
					result = true;
			},
			error : function() {
				alert("连接服务器失败");
			}
		});
		if (result == false)
			onchange_checkbox.attr('checked', !type);
		return result;
	}
	
	function toMain(){
		$("#mainContainer").attr("src","trademanage/showTradeList.do");
	}
	
	function toFollowers(){
		$("#mainContainer").attr("src","trademanage/listFollowers.do");
	}
	
	function toIdols(){
		$("#mainContainer").attr("src","trademanage/listIdols.do");
	}
	
	function setTradeInfo(){
		$("#mainContainer").attr("src","trademanage/setTradeInfo.do");
	}
</script>

</head>

<body id="ctl00_body">
	<!-- BodyContainer start -->
	<div id="BodyContainer">
		<!-- main start -->
		<div id="Main" class="clearfix">
			<!-- header container start -->
			<div class="header container">
				<h1>
					<a href="/">测试</a>
				</h1>
				<div class="clear">
					<div class="loginBox">
						<a class="" href="/login"> 帮助</a> | <a class="" href="/login">
							注销登录</a>
					</div>
				</div>
			</div>
			<!-- header container end -->

			<!-- menuContent start -->
			<div class="menuContent">
				<div class="container clear">
					<ul class="mainMenu">
						<li><a class='selected' href='/twitter'>首页</a>
						</li>
						<li><a href='/followers'>兴趣爱好</a>
						</li>
						<li><a href='/apps'>赏金任务</a>
						</li>
						<li><a href='/seeds'>其他</a>
						</li>
						<li><a href='/how-to-twitter'>其他</a>
						</li>
						<li><a class='hide' href=''></a>
						</li>
						<li><a class='hide' href='/login'></a>
						</li>
						<li><a class='hide' href=''></a>
						</li>
					</ul>
				</div>
				<div class="menuBar clearfix">
					<div class="container">
						<ul>
							<li><a href='javascript:toMain()'>主页</a>
							</li>
							<li><a href='javascript:toFollowers()'>谁粉过我</a>
							</li>
							<li><a href='javascript:toIdols()'>我粉过谁</a>
							</li>
							<li><a href='javascript:to()'>粉丝成长</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<!-- menuContent end -->
			<!-- searchBar start -->
			<div class="searchBar">
				<div class="container clearfix" style="height: 15px">
					<h6>滚动显示当前活动的人。</h6>
				</div>
				<div class="bottom">&nbsp;</div>
			</div>
			<!-- searchBar end -->

			<!-- ctl00_UpdatePanel1 start -->
			<div id="ctl00_UpdatePanel1">
				<div class="main container">
					<iframe src="trademanage/showTradeList.do" class="mainContent"
						scrolling="no" style="height: 640px" id="mainContainer"> </iframe>
				</div>
			</div>
			<div id="ctl00_Sidebar" class="sidebar">
				<input type="hidden" id="tradeId"
					value="${userBean.ttTradeinfo.tradeId}"></input>
				<div id="ctl00_CPR_Signup1_UP4">
					<div id="ctl00_CPR_Signup1_PanelOuter" class="registration">
						<div class="userImgBorder"></div>
						<img id="myself" src="${session.user.imgUrl }"
							wb_user_id="${session.sinaId }"
							wb_screen_name="${session.user.userSinaName}" class="userImg" />
						<div class="seedsShow">
							<b id="nowBalance" style="font-size: 60px; color: #555;">${userBean.ttTradeinfo.balance
								}</b><b style="font-size: 15px; color: #666;">粉币</b> <br /> <a
								href="javascript:freshBalance()"
								style="font-size: 12px; margin: 10px 0 0 30px">刷新</a>
						</div>
						<div class="userProfile">
							<h4>昵称：${session.user.userName }</h4>
							<h4>信誉度：${userBean.creditLevel }</h4>
							<h4>
								follow数：<em id="followNum">${userBean.followNum }</em>
							</h4>
							<h4>
								今日剩余次数：<b id="remainingNum">${userBean.remainNumByDay }</b>
							</h4>
							<a href="javascript:setTradeInfo()">设置参数</a>
							<p class="css_sized_container">
								<input type="checkbox" id="css_sized_container"
									<s:if test="userBean.ttTradeinfo.isStop == 0">checked</s:if> />
							</p>
						</div>
						<span id="ctl00_CPR_Signup1_LabelStatus"
							class="status ajaxholder1"> <a
							style='font-weight: bold; text-decoration: underline;'
							href='/terms'></a> </span>
					</div>
				</div>
				<div class="features">
					<h4>粉丝动态：</h4>
					<b>+38</b>
				</div>
				<div class="featuresBottom"></div>
			</div>
		</div>
	</div>
	<!-- ctl00_UpdatePanel1 end -->

	</div>
	<!-- main end -->
	</div>
	<!-- BodyContainer start -->

	<!-- footer start -->
	<div class="footer">
		<div class="container">
			<ul>
				<li><a href="/">主页</a>
				</li>
				<li><a href="/rules">规则</a>
				</li>
				<li><a href="/privacy">隐私声明</a>
				</li>
				<li><a href="/faq">常见问题</a>
				</li>
				<li><a href="/help">帮助</a>
				</li>
				<li><a href="" style="margin-right: 100px;">支持</a>
				</li>
			</ul>
		</div>
	</div>
	<!-- footer end -->

</body>
</html>
